async function repGetUserInfo() {
  const res = await GetUserInfo()
  let {
    data: { nickname, username, email, id },
  } = res.data
  $('.layui-card input[name=username]').val(username)
  $('.layui-card input[name=nickname]').val(nickname)
  $('.layui-card input[name=email]').val(email)
  $('.layui-card input[name=id]').val(id)
}
repGetUserInfo()
const { form } = layui
form.verify({
  nickname: [/^[\u4E00-\u9FA5]+$/, '只能输入汉字的昵称'],
})
$('.layui-form').on('submit', async function (e) {
  e.preventDefault()
  const obj = {
    nickname: $('.layui-card input[name=nickname]').val(),
    email: $('.layui-card input[name=email]').val(),
    id: $('.layui-card input[name=id]').val(),
  }
  const res = await postReviseInfo(obj)
  window.parent.reqGetInfo()
})
$('.my-reset').on('click', function (e) {
  e.preventDefault()
  repGetUserInfo()
})
